<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Usever</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
  <div id="app">
    <ul>
      <li v-for="item in list" :key="item">
        <a :href="item">{{item}}</a>
      </li>
    </ul>
  </div>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        message: 'Hello Vue!',
        list: []
      },
      methods: {
        async get_list() {
          const resp = await fetch('http://localhost:1998/list');
          const data = await resp.json();
          if (data.code == 200) {
            this.list = data.payload.list
          }
        }
      },
      mounted() {
        this.get_list();
      },
    });
  </script>
</body>

</html>